package com.wsh.enums;


public enum BadStatusEnum {
    TABLE_BAD_EXIST_DATA(5009401, "表中存在数据,不能对表进行操作"),
    TABLE_BAD_COLUMNLENGTH(5009402, "表字段长度不符合规则"),
    TABLE_BAD_COLUMNNAME(5009403, "表字段名称不能为空"),


    TABLE_ALTER_BAD_COLUMN(5009501, "表字段属性修改失败"),
    TABLE_ALTER_BAD_COLUMNCOMMENT(5009502, "表字段注释修改失败"),
    TABLE_ALTER_BAD_TABLENAMENULL(5009503, "表名不能为空"),
    ;

    private Integer code;
    private String msg;

    BadStatusEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static String getValue(int code) {
        for (BadStatusEnum c : BadStatusEnum.values()) {
            if (c.getCode() == code) {
                return c.getMsg();
            }
        }
        return null;
    }
}
